﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using System.Web.Configuration;
using Domain;

namespace HotelBrisaYArenaAdministrador
{
    public partial class EliminarReservacion : System.Web.UI.Page
    {
        ReservacionBusiness resBusbiness = new ReservacionBusiness(WebConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Reservacion"] != null)
            {
                Reservacion reservacion = (Reservacion)Session["Reservacion"];
                lblidReservacion.Text = reservacion.IdReservacion.ToString();
                lblNombre.Text = reservacion.NombreCliente;
                lblApellidos.Text = reservacion.ApellidosCliente;
            }
        }

        protected void btnAceptar_Click(object sender, EventArgs e)
        {
            Reservacion reservacion = (Reservacion)Session["Reservacion"];
            resBusbiness.EliminaReservacion(reservacion.IdReservacion);
            Response.Redirect("PaginaPrincipal.aspx?mensaje=Transacción realizada correctamente");
        }
    }
}